<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/5/19
  Time: 23:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>添加内存</title>
</head>
<body>
<div style="border: 1px solid #E6E6E6;width: 350px;margin:auto;">
    <form id="addMemoryForm" style="margin-top: 20px;font-size: 15px;font-family: 微软雅黑;">
        <div style="margin-bottom:20px;text-align: center;">
            <input class="easyui-textbox" name="brand" data-options="label:'内存品牌',width:300,height:30,required:true,missingMessage:'品牌不能为空！'">
        </div>
        <div style="margin-bottom:20px;text-align: center;">
            <input class="easyui-textbox" name="capacity" data-options="label:'内存容量',width:300,height:30,required:true,missingMessage:'容量不能为空！'">
        </div>
        <div style="margin-bottom:20px;text-align: center;">
            <input class="easyui-textbox" name="frequency" data-options="label:'内存频率',width:300,height:30,required:true,missingMessage:'频率不能为空！'">
        </div>
        <div style="margin-bottom:20px;text-align: center;">
            <input class="easyui-textbox" name="type" data-options="label:'传输类型',width:300,height:30,required:true,missingMessage:'传输类型不能为空！'">
        </div>
    </form>
    <div style="text-align:center;padding:5px 0">
        <a class="easyui-linkbutton" onclick="$('#addMemoryForm').form('submit');" style="width:80px">提交</a>
        <a class="easyui-linkbutton" onclick="$('#addMemoryForm').form('clear');" style="width:80px">重置</a>
    </div>
</div>
<script>
    $(function () {
        $('#addMemoryForm').form({
            url:'../memory/addMemory',
            type:'post',
            success:function(data){
                var data = eval('(' + data + ')');
                if (data.result === 'success') {
                    $('#addMemoryForm').form('clear');
                }
                $.messager.alert('提示', data.message, 'info');
            }
        });
    });
</script>
</body>
</html>
